﻿@if (AuditProperties != null)
{
    <Table PageSize="AuditProperties.Count" DataSource="@AuditProperties" Bordered=@true Size=@TableSize.Small HidePagination="true">
        <Column @bind-Field="@context.FieldName" Title="@Localizer[AuditLocalResource.FieldName]" />
        <Column @bind-Field="@context.DisplayName" Title="@Localizer[AuditLocalResource.DisplayName]" />
        <Column @bind-Field="@context.DataType" Title="@Localizer[AuditLocalResource.DataType]" />
        @if (!EntityOperateType.Insert.Equals(OperationType))
        {
            <Column @bind-Field="@context.OriginalValue" Style="max-width:200px" Title="@Localizer[AuditLocalResource.OriginalValue]" />
        }
        @if (!EntityOperateType.Delete.Equals(OperationType))
        {
            <Column @bind-Field="@context.NewValue" Style="max-width:200px" Title="@Localizer[AuditLocalResource.NewValue]" />
        }
    </Table>
}

@code {
    /// <summary>
    /// 属性审计信息
    /// </summary>
    [Parameter]
    public ICollection<AuditPropertyDto>? AuditProperties { get; set; }
    /// <summary>
    /// 操作类型
    /// </summary>
    [Parameter]
    public EntityOperateType OperationType { get; set; }
    /// <summary>
    /// 本地化
    /// </summary>
    [Parameter]
    [System.ComponentModel.DataAnnotations.Required]
    public IClientLocalizer Localizer { get; set; } = null!;
}
